#ifndef ARSADAPTER_H
#define ARSADAPTER_H

#include <QSqlDatabase>

#include <adapterinterface.h>
#include <staticmodel.h>

class ARSAdapter : public QObject,
                   public StaticModelAdapterPluginInterface
{
    Q_OBJECT
    Q_INTERFACES(PluginInterface StaticModelAdapterPluginInterface)

public:
    ARSAdapter(QObject * parent = 0);

    QString name() const;
    QString description() const;
    bool connectToDatabase(const QString & host, int port, const QString & dbName,
                           const QString & login, const QString & password);
    ServerModel * createModel();

private:
    ARSExpr * parseExpr(const QString expr, QObject * parent);

    QSqlDatabase m_db;
};

#endif // ARSADAPTER_H
